
local CommonOHOH=_G.CommonOHOH
local rank_cfg=_G.CommonOHOH.config.Rank
--local gMaxSlotCount=10
local CarTool=_G.CommonOHOH.load.CarTool();

local M={}


--根据积分，获取段位信息
function M.GetInfo(score)
    for k, v in ipairs(rank_cfg) do
        if v.point > score then
            return rank_cfg[k-1]
        end
    end
    return rank_cfg[#rank_cfg]
end
--根据isWin和玩家总score，获取积分奖励值
function M.GetReward(isWin,score)
    local info = M.GetInfo(score)

    if isWin then
        return info.win
    else
        return -info.lose
    end


end
function M.GetAllCarIdBySkinData(data)
    local bodyId, flagId, ringId, tailId, weaponId = nil, nil, nil, nil, nil
    for carId,status in pairs(data) do
        local type = CarTool.GetPartCfgData(carId).type
        if type == 1 then
            weaponId = carId
        elseif type == 2 then
            ringId = carId
        elseif type == 3 then   
            bodyId = carId
        elseif type == 4 then
            tailId = carId
        elseif type == 5 then 
            flagId = carId
        end
    end
    return bodyId,flagId,ringId,tailId,weaponId
end

return M